<link rel="stylesheet" type="text/css" href="css/administration.css" media="screen" />
<style>
div#polje_lista div.polje_sadrzaj{
	float:left;
	width:235px;
	min-height:21px;
	margin:5px 0px 0px 0px;
	padding:2px;
}
div#polje_lista input.datum_start{
	width:100px;
	text-align:center;
}
div#polje_lista input.datum_end{
	width:100px;
	text-align:center;
}
div#polje_lista input.kampanja{
	width:70px;
	text-align:center;
}
div.edit_artikli{
	float:left;
	clear:both;
	margin:-1px 0px 0px 54px;
	padding:5px 5px 0px 5px;
	background:#fefefe;
	border:1px solid #7F9DB9;
}
div.polje_item{
	margin:0px 0px 5px 0px;
	padding:0px 0px 5px 0px;
}
input.add{
	width:24px;
	height:24px;
	margin:30px 0px -20px -26px;
	padding:0px 2px;
	position:relative;
	color:#7F9DB9;
	font-weight:bolder;
	font-size:20px;
	background:none;
	border:1px solid transparent;
	cursor:pointer;
}
input.add:hover{
	border:1px solid #7F9DB9;
}
input.remove{
	width:16px;
	height:16px;
	padding:0px 4px;
	margin:7px 5px 5px 5px;
	padding:2px;
	background:url(gui/icons/delete.gif) no-repeat center center;
	border:1px solid transparent;
	cursor:pointer;
	text-indent:-100em;
	overflow:hidden;
}
input.remove:hover{
	border:1px solid #555;
}
input#save_btn,
input#cancel_dodaj_btn{
	display:none;
}
div#hidden_polje{
	float:left;
	margin:0px;
	width:940px;
	display:none;
}
#polje_new{
	width:950px;
	margin-bottom:-1px;
}
#top_tools{
	float:left;
}
div#hidden_polje input,
div#hidden_polje select,
div#hidden_polje label{
	float:left;
}
div#hidden_polje select{
	width:150px;
	overflow:visible;
}
div#hidden_polje label{
	width:70px;
	text-align:right;
	padding-top:8px;
}
</style>
<div id="main_body" class="main_body" style="display:none">
<div class="top_menu">
<strong>Administracija Cenovnika</strong>
	<div class="kategorija_listbox">
Cenovnici :
	<select id="cenovnici_lista" name="cenovnici_lista" onchange="changeValCenovnik(this);" onblur="" style="width:280px;">
	<optgroup label="Izaberite cenovnik" >
	<option value="0">--Svi cenovnici--</option>
	{{%loop start cen_id_list}}
	<option value="{{$cen_id_list}}" {{$kat_select_list}}>{{$cen_start_list}}</option>
	{{%loop end}}
	</optgroup>
	</select>
	<input type="button" value="Prikaži" title="kliknite ovde da prikažete listu cena iz cenovnika" onclick="l=document.getElementById('cenovnici_lista'); kid=l.options[l.selectedIndex].value; showCenovnici(cid);" />
	</div>
	<div class="top_navigacija">
		<span id="top_izvestaj" name="top_izvestaj">{{$top_izvestaj}}</span>Nađeno je {{$broj_polja}} unosa na {{$broj_strana}} &nbsp;strana. {{$link_pocetno}} {{$link_prethodno}} {{$link_strane}} {{$link_sledece}} {{$link_poslednje}} 
	</div>
	<br clear="all" />
	<div id="top_tools">
	<input type="button" onclick="new_Cene()" value="Nova" id="dodaj_btn" />
	<input type="button" onclick="cancel_new_Cene()" value="Poništi dodavanje" id="cancel_dodaj_btn" />
	<input type="button" onclick="add_Cene();" value="Sačuvaj novu cenu" id="save_btn" />
	<input type="hidden" value="{{$broj_polja_na_strani}}" id="broj_polja_na_strani" />
	</div>
</div><br clear="all" />
<!------------NEW START------style="display:none;"--------------->
<div >
<div id="hidden_polje" class="edit_artikli">
	<label for="sifra_artikla">Artikal:</label>
	<select id="sifra_artikla" name="sifra_artikla" >
		<option value="0">---</option>
		<optgroup label="Izaberite artikal" >
		{{%loop start art_id}}
			<option value="{{$art_id}}" {{$kat_select_list}}>{{$art_name}} - {{$art_grupa_id}}</option>
		{{%loop end}}
		</optgroup>
	</select>
	<label for="tip_artikla">Tip artikla:</label>
	<select id="tip_artikla" name="tip_artikla" >
		<option value="0">---</option>
		<optgroup label="Izaberite tip artikla" >
		{{%loop start art_tip_id}}
			<option value="{{$art_tip_id}}" {{$kat_select_list}}>{{$art_tip_name}}</option>
		{{%loop end}}
		</optgroup>
	</select>
	<label for="boja_artikla">Boja artikla:</label>
	<select id="boja_artikla" name="boja_artikla" >
		<option value="0">---</option>
		<optgroup label="Izaberite boju artikla" >
		{{%loop start art_boja_id}}
			<option value="{{$art_boja_id}}" {{$kat_select_list}}>{{$art_boja_name}} - {{$art_boja_code}}</option>
		{{%loop end}}
		</optgroup>
	</select><br clear="all" />
	<label for="kampanja">Kampanja:</label>
	<select id="kampanja" name="kampanja" >
		<option value="0">---</option>
		<optgroup label="Izaberite kampanju" >
		{{%loop start kamp_id}}
			<option value="{{$kamp_id}}" {{$kat_select_list}}>{{$kamp_name}}</option>
		{{%loop end}}
		</optgroup>
	</select>
	<label for="porez">Porez:</label>
	<select id="porez" name="porez" >
		<option value="0">---</option>
		<optgroup label="Izaberite porez" >
		{{%loop start porez_id}}
			<option value="{{$porez_id}}" posto="{{$porez_procenat}} " {{$kat_select_list}}>{{$porez_name}}</option>
		{{%loop end}}
		</optgroup>
	</select>
	<label for="cenovnik">Cenovnik:</label>
	<select id="cenovnik" name="cenovnik" >
		<option value="0">---</option>
		<optgroup label="Izaberite cenovnik" >
		{{%loop start cenovnik_id}}
			<option value="{{$cenovnik_id}}" {{$kat_select_list}}>{{$cenovnik_start}}</option>
		{{%loop end}}
		</optgroup>
	</select>
	<label for="polje_cena_new">Cena:</label>
	<input id="polje_cena_new" type="hidden" value="" onchange="" />
	<input type="text" value="" title="Unesite cenu proizvoda" id="polje_cena_new" name="polje_cena_new" />
</div>
</div>

<form class="area" id="polje_new" style="display:none;">

<input type="hidden" id="new_artikal" />
<input type="hidden" id="new_artikal_tip" />
<input type="hidden" id="new_artikal_boja" />
<input type="hidden" id="new_kamp" />
<input type="hidden" id="new_porez" />
<input type="hidden" id="new_cenovnik" />
<input type="hidden" id="new_cena" />

	<div id="new_edit"></div>
</form>
<!-------------NEW END-------------------->
<form class="area" id="glavnaForma">
<div class="polje_legend" style="width:950px">
	
	<div class="polje_legend_item_id">ID</div>
	<div class="polje_legend_item" style="width:80px;">Artikal</div>
	<div class="polje_legend_item" style="width:110px;">Tip</div> 
	<div class="polje_legend_item" style="width:110px;">Boja</div>
	<div class="polje_legend_item" style="width:40px;">Porez</div>
	<div class="polje_legend_item" style="width:160px;">Kampanja</div>
	<div class="polje_legend_item" style="width:80px;">Cenovnik</div>
	<div class="polje_legend_item" style="width:80px;">Cena</div>
	</div>
<div id="polje_lista" style="width:950px;">
	{{%loop start polje_id}}
	<div class="polje_item" title="{{$polje_cena_naziv}}" style="width:100%">
	<div id="edit_polje_{{$polje_id}}"></div>
		<input type="hidden" value="{{$polje_id}}" id="polje_id_{{$polje_id}}" />
		<input type="hidden" id="r_{{$polje_id}}" value="0" />
		<div id="polje_item_elementi_{{$polje_id}}">

		<input name="text" type="text" disabled="disabled" style="width:30px; text-align:center" value="{{$polje_id}}" />
		
		
		<!-- artikl -->
		<input id="polje_art_id_{{$polje_id}}" type="hidden" value="{{$polje_art_id}}" />
		<input class="artikal" id="polje_art_name_{{$polje_id}}" disabled="disabled" value="{{$polje_art_name}}" style="width:80px; text-align:center" />
		<!-- tip -->
		<input id="polje_art_tip_id_{{$polje_id}}" type="hidden" value="{{$polje_art_tip_id}}" />
		<input id="polje_art_tip_name_{{$polje_id}}" type="text" value="{{$polje_art_tip_name}}" disabled="disabled" style="width:110px; text-align:center" />
		<!-- boja -->
		<input id="polje_art_boja_id_{{$polje_id}}" type="hidden" value="{{$polje_art_boja_id}}" />
		<input id="polje_art_boja_name_{{$polje_id}}" disabled="disabled" value="{{$polje_art_boja_name}}" type="text" style="width:80px; text-align:center" />
		<!-- porez -->
		<input id="polje_porez_id_{{$polje_id}}" type="hidden" value="{{$polje_porez_id}}" />
		<input type="text" disabled="disabled" id="polje_porez_name_{{$polje_id}}" title="{{$polje_porez_name}}" value="{{$polje_porez_procenat}}"  style="width:45px; text-align:center" />
		<!-- kampanja -->
		<input id="polje_kamp_id_{{$polje_id}}" type="hidden" value="{{$polje_kamp_id}}" />
		<textarea id="polje_kamp_name_{{$polje_id}}" disabled="disabled" style="width:140px; text-align:center; background:none; border:none;" rows="2" wrap="soft">{{$polje_kamp_name}}</textarea>
		<!-- cenovnik -->
		<input id="polje_cenovnik_id_{{$polje_id}}" type="hidden" value="{{$polje_cenovnik_id}}" />
		<input type="text" disabled="disabled" id="polje_cenovnik_start_{{$polje_id}}" value="{{$polje_cenovnik_start}}"  style="width:80px; text-align:center" />
		<!-- cena -->
		<input type="text" disabled="disabled" id="polje_cena_{{$polje_id}}" value="{{$polje_cena}}"  style="width:80px; text-align:center" />
		<div id="polje_sadrzaj_elementi_{{$polje_id}}" class="polje_sadrzaj_elementi"></div>
		</div>
		<div class="item_tools" style="float:right; clear:left;">
			<a id="delete_{{$polje_id}}" href="javascript:void(0);" onclick="del_Cene('{{$polje_id}}');" title="kliknite da izbrišete polje {{$polje_name}}">
				<img src="gui/icons/delete.gif" alt="" />
			</a>
			<a id="save_{{$polje_id}}" href="javascript:void(0);" onclick="saveChanges_Cene('{{$polje_id}}');" title="kliknite da sačuvate izmene na polju {{$polje_name}}" style="display:none;">
				<img src="gui/icons/save.gif" alt="" />
			</a>
			<a id="edit_{{$polje_id}}" href="javascript:void(0);" onclick="changeEdit_Cene('{{$polje_id}}');" title="kliknite za izmenu polja {{$polje_name}}" >
				<img src="gui/icons/edit.gif" alt="" />
			</a>
			<!--<input type="button" id="dodaj_artikl_{{$polje_id}}" value="+" title="Dodaj artikl" onclick="dodaj_artikal({{$polje_id}});" style="display:none;"  />-->
		</div>
		<br clear="all" />
		
	</div>
	{{%loop end}}

</form>

<script>
document.getElementById("main_body").style.display = "block";
</script>